home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0793july.archive / 000059_crash!mars.let.uva.nl!wouter_Fri, 23 Jul 93 19:44:30 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  5KB

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Fri, 23 Jul 93 19:44:30 PST
  3. Received: from mars.let.uva.nl by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #15) id m0oJYeg-0000ZcC; Fri, 23 Jul 93 18:44 PDT
  5. Received: by mars.let.uva.nl id AA01348
  6.   (5.65c/IDA-1.4.4 for amigae@bkhouse.cts.com); Sat, 24 Jul 1993 03:47:52 +0200
  7. Return-Path: <wouter@mars.let.uva.nl>
  8. Date: Sat, 24 Jul 1993 03:47:52 +0200
  9. Message-Id: <199307240147.AA01348@mars.let.uva.nl>
  10. X-Organisation: Department of Computational Linguistics,
  11.                 University of Amsterdam
  12.                 Spuistraat 134, 1012 VB Amsterdam, The Netherlands
  13. From: Wouter van Oortmerssen <wouter@mars.let.uva.nl>
  14. To: amigae@bkhouse.cts.com
  15. Subject: Listviews and windows
  16.  
  17. >> Hi! 
  18. >> 
  19. >>     I have been using E for about a month, and in that time have run into a
  20. >> few problems (bugs? or just ignorance? :-) 
  21.  
  22. judge for yourselves... :-)
  23.  
  24. >>     A friend and I have been stumped on two problems:
  25. >> 
  26. >>     (1) The first one is adding nodes to a Listview from Gadtools in a loop
  27. >> I had a project I was working on (subsequently scrapped) that needed a text
  28. >> file to be read in line by line (ReadStr in a loop) and that line then added
  29. >> to my listview. I was reading in the file before making the gadget. What I wa
  30.  
  31. >> doing was passing AddTail while in the loop, but for some strange reason, the
  32. >> list view would only appear with the LAST line passed by the loop.  When I
  33. >> used addtail outside of the loop, it worked perfectly, but it would be crazy
  34. >> to hardcode all of what I wanted directly into the program (2500+ taglines!)
  35.  
  36. It's very likely that you are using a statement of the form:
  37.  
  38. AddTail(mylist,[...data..for..new..node...])
  39.  
  40. a structure like [] is a static structure, i.e. the memory it's
  41. in is not created at run time. because of this, every iteration
  42. of your loop, you overwrite the previous values, and pass the
  43. same structure to AddTail()! Instead, allocate each time a new node
  44.  
  45. New(SIZEOF ln)
  46.  
  47. and then fill it, and pass it to AddTail().
  48.  
  49. >>     I would still very much like to know how to get this working, even though
  50. >> that project has been dumped (my new QWK reader supports taglines, and so doe
  51.  
  52. >> my new Point-Mail reader)...as I will probably encounter this again.
  53. >> 
  54. >>     (2) Here is the one that is currently screwing me up: A friend and I are
  55. >> working on an interface to E. (the "E Development System") When finished, it
  56. >> is going to revise the source (with time and date stamp, along with
  57. >> comments--already got most of this working) and call the text editor (perhaps
  58. >> have a built in one(?)) and be able to run any options the user has (EPP).  I
  59.  
  60. >> has a very lovely, multi-window interface, all done in gadtools.  The problem
  61. >> is getting IDCMP messages from the different windows.  Right now I am using
  62. >> a modified version of the wait4message from the examples, using
  63. >> IDCMP_INACTIVEWINDOW to switch the window ptr being passed to wait4msg.  This
  64. >> is very clumsy (often I have to click in and out of windows before a gadget
  65. >> passes the message).  My friend is using converted C source doing it the
  66. >> "right way" (modifying IDCMP), but I have not yet gotten this source to look
  67. >> at, and it keeps crashing on him when he closes the windows. (We have looked
  68. >> at everything - calling modifyidcmp w/ NIL as the arg, CloseWindowSafely, and
  69. >> all that junk) but it is still not working for him.  I cannot use this, cause
  70. >> it would kill me haveing to wait for a reboot (not even gives a failed req!)
  71. >> when trying out new code.
  72.  
  73. I have no clue what's crashing your machine, I'd need the code for that.
  74.  
  75. I can help you with the windows, though:
  76. Here's how you wait for messages from various windows:
  77.  
  78. method one:
  79.  
  80. - OR the sigbits from all windows involved into a variable "allsigs"
  81. - in a loop, perform a Wait(allsigs)
  82. - in a loop within that one, call GetMsg() in sequence on items
  83.   of a list of ports (window.userport), until all have been processed.
  84.  
  85. you can see from intuimessage.idcmpwindow which window
  86. actually caused the message.
  87.  
  88. method two.
  89.  
  90. if you don't want to wait for more than one port, you can CreatePort()
  91. your own, and connect all windows you open with this one port.
  92. you'll then receive all messages here, and can decide which it
  93. was from like in method one. How this is done in detail is
  94. on page 254 of the RKRM libraries 3rd ed.
  95.  
  96. >>     This one is of VITAL importance. Both of these Qs are probably being
  97. >> posted simultaneously here by my partner in crime, George Beasly. Just reply
  98. >> to one of us...
  99. >> 
  100. >>  / / /
  101. >> /_/_/iZ
  102. >> 
  103. >> *-- The Gamma Quadrant --*
  104. >> 
  105. >> 
  106. >> *-- GammaTag Version 2.8 --*
  107. >> *-- *-- DOS ERROR: Please remove cat from drive DF0:...
  108.  
  109. miauw!
  110.  
  111. Wouter
  112.  
  113.    ____  Wouter van Oortmerssen, Wouter@alf.let.uva.nl
  114.   / __/  "Einen Satz verstehen, heisst, wissen was der Fall ist,
  115.  / __/    wenn er wahr ist" - Wittgenstein
  116. /___/  ->subscribe to the E mailing list: amigae-request@bkhouse.cts.com<-